package cn.tedu.boot44.mapper;

import cn.tedu.boot44.entity.Logistics;
import cn.tedu.boot44.entity.Sales;
import cn.tedu.boot44.entity.Technology;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Classname: SalMapper
 * @Author: bromide
 * @CreateTime: 2022/5/16--下午9:16
 * @Version: V1.0
 * @Description:
 */
@Mapper
public interface SalMapper {
    @Insert("insert into salessal values(#{id},#{name},#{baseSal},#{saleCount},#{bonus},#{endSal})")
    void insertSales(Sales sales);

    @Insert("insert into techsal values(#{id},#{name},#{baseSal},#{score},#{bonus},#{endSal})")
    void insertTech(Technology technology);

    @Insert("insert into logsal values(#{id},#{name},#{baseSal},#{bonus},#{endSal})")
    void insertLog(Logistics logistics);

    @Select("select bonus from techsal union select bonus from salessal union select bonus from logsal")
    List<Double> selectBonus();
}